﻿//-----------------------------------------------------------------------
// <copyright file="Job.cs" company="FastNET Services">
//     Copyright (c) 2007-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings

using System;
using System.Collections.Generic;
using FastNET.CleanAct.Client.Interfaces.Jobs;
using FastNET.CleanAct.Client.Interfaces.Tasks;

#endregion

namespace FastNET.CleanAct.Client.ClientEngine.Jobs
{
    /// <summary>
    /// Basic job class for all jobs
    /// </summary>
    internal class Job : IJob
    {
        #region Variables

        private readonly List<ITask> _taskList;
        private readonly List<string> _processedBy;
        private readonly IDictionary<Guid, IJobAction> _actionList;

        #endregion

        #region CTor/DTor

        /// <summary>
        /// Initializes a new instance of the Job class
        /// </summary>
        public Job()
        {
            _taskList = new List<ITask>();
            _processedBy = new List<string>();
            _actionList = new Dictionary<Guid, IJobAction>();
        }

        #endregion

        #region Public Collection Properties

        /// <summary>
        /// Gets a list of all tasks for the job
        /// </summary>
        public IList<ITask> TaskList
        {
            get
            {
                return _taskList;
            }
        }

        /// <summary>
        /// Gets a list of all the processor names that processed this job
        /// </summary>
        public IList<string> ProcessedBy
        {
            get
            {
                return _processedBy;
            }
        }

        /// <summary>
        /// Gets a list of all actions associated with the job
        /// </summary>
        public IDictionary<Guid, IJobAction> ActionList
        {
            get
            {
                return _actionList;
            }
        }

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the name for the job
        /// </summary>
        public string JobName { get; set; }

        /// <summary>
        /// Gets or sets a brief description of the job
        /// </summary>
        public string JobDescription { get; set; }

        #endregion
    }
}
